let jwt = require("jsonwebtoken");
let config = require("./libs/config");

//  何时返回token  要根据自己的业务逻辑
app.get("/getToken", function(req, res) {
  let token = jwt.sign(
    {
      name: "BinMaing",
      data: "============="
    },
    config.secretOrPrivateKey,
    {
      expiresIn: 60 * 60 * 24 * 2
    }
  );
  res.json({
    result: "ok",
    token
  });
});
